
ifndef OUTDIR
#OUTDIR=classes
OUTDIR=.
endif
ifndef SUBDIR
#SUBDIR=$(CURDIR)
SUBDIR=.
endif
ifndef SRCDIR
SRCDIR=.
#SRCDIR=$(CURDUR)
endif

sources = $(wildcard *.java)
targets = $(subst .java,.class,$(sources))
jarfiles = $(wildcard *.jar)

#cp := $(foreach jarfile,$(jarfiles),./$(jarfile):)
#cp := $(strip $(cp))
#cp := $(subst : ,:,$(cp))
cp:=/usr/local/lib/JEREMIE_jonas.jar:../lib/AKbeansclient.jar

default: any all
any:
	@echo
	@echo ------------------------
	@echo sources=$(sources)
	@echo targets=$(targets)
	@echo

%.class : %.java
	@echo
	@echo Target: $@

	javac -classpath $(cp):$(J2EE_HOME)/lib/j2ee.jar  $<
	@echo Finished target $@
	@echo

	 
all:  $(targets)

clean: 
	rm -rf $(OUTDIR)/$(SUBDIR)/*.class

